home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet multimedia
/
Linux LiveCD
/
GeeXboX 1.0 EN
/
geexbox-1.0-en.i386.iso
/
GEEXBOX
/
etc
/
init.d
/
75_mp-tvcard
< prev
next >
Wrap
Text File
|
2006-06-21
|
3KB
|
77 lines
#!/bin/sh
#
# configure MPlayer's v4l2 settings
#
# runlevels: geexbox, debug
echo "### Configuring MPlayer's v4l2 support ###"
if [ -f /var/tvcard -a -c /dev/video0 ]; then
. /etc/tvcard
. /var/tvcard
# configure mplayer v4l2 driver
if [ -n "$TV_WIDTH" -a -n "$TV_HEIGHT" ]; then
TV_OPTIONS=":width=$TV_WIDTH:height=$TV_HEIGHT"
fi
if [ -n "$TV_BRIGHTNESS" ]; then
TV_OPTIONS="$TV_OPTIONS:brightness=$TV_BRIGHTNESS"
fi
if [ -n "$TV_CONTRAST" ]; then
TV_OPTIONS="$TV_OPTIONS:contrast=$TV_CONTRAST"
fi
if [ -n "$TV_HUE" ]; then
TV_OPTIONS="$TV_OPTIONS:hue=$TV_HUE"
fi
if [ -n "$TV_SATURATION" ]; then
TV_OPTIONS="$TV_OPTIONS:saturation=$TV_SATURATION"
fi
if [ `grep -c ^CHAN /etc/tvcard` -gt 0 ]; then
for CHAN in `sed -n 's/^CHAN="\(.*\):\(.*\)"/\1-\2/p' /etc/tvcard | sed 'y/ /_/' `; do
mp_set_option tv=channels "$CHAN" concat
done
else
sed "s/.*set_menu tv_chan.*//" /etc/mplayer/menu.conf
fi
echo "tv=driver=v4l2:norm=$TVIN_STANDARD:chanlist=$CHANLIST$TV_OPTIONS" >> /etc/mplayer/mplayer.conf
if [ -x /usr/bin/mencoder ]; then
AUDIO_OPTIONS=`cat /var/recorder_alsa`
sed -i "s/^#tv=tv_options.*/tv=driver=v4l2:norm=$TVIN_STANDARD:chanlist=$CHANLIST$TV_OPTIONS$AUDIO_OPTIONS/" /etc/mplayer/mencoder.conf
TV_CHANNELS=`grep -e tv=channels /etc/mplayer/mplayer.conf`
sed -i "s/^#tv=tv_channels.*/$TV_CHANNELS/" /etc/mplayer/mencoder.conf
fi
IFS='
'
# set mplayer TV channels list
echo "<cmdlist name=\"tv_chan\" title=\"TV Channels\" ptr=\"\" item-bg=\"-1\" title-bg=\"-1\" ptr-bg=\"164\" auto-close=\"yes\" >" >> /etc/mplayer/menu.conf
for CHNAME in `sed -n 's/^tv=channels=//p' /etc/mplayer/mplayer.conf | sed -e 's/,/\n/g' -e 's/_/ /g' | sed 's/\(.*\)-\(.*\)/\2/'`; do
echo "<e name=\"$CHNAME\" ok=\"loadfile tv://$((++n))\"/>" >> /etc/mplayer/menu.conf
done
echo "</cmdlist>" >> /etc/mplayer/menu.conf
else
# remove tv options from menu
sed -i 's/.*ok="set_menu tv_settings".*//' /etc/mplayer/menu.conf
sed -i 's/.*ok="set_menu tv_norm".*//' /etc/mplayer/menu.conf
fi
[ -f /var/digimatrix ] && sed -i 's/set_menu radio_settings/set_menu digimatrix_radio/' /etc/mplayer/menu.conf
[ -f /etc/radio ] && . /etc/radio
if [ "$RADIO" = yes ]; then
# set mplayer menu radio stations list
echo "<cmdlist name=\"radio_chan\" title=\"Radio Stations\" ptr=\"\" item-bg=\"-1\" title-bg=\"-1\" ptr-bg=\"164\" >" >> /etc/mplayer/menu.conf
grep '^CHAN' /etc/radio | sed "s/^CHAN=\"\([^:]*\):\(.*\)\"/<e name=\"\2\" ok=\"run 'fmio -d v4l -v 50 -f \1'\"\/>/" >> /etc/mplayer/menu.conf
echo "</cmdlist>" >> /etc/mplayer/menu.conf
else
# no supported radio card specified
sed -i 's/.*ok="set_menu radio_settings".*//' /etc/mplayer/menu.conf
fi
exit 0